<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('修改入库')"/>
    <style>
        [v-cloak] {
            display: none;
        }
    </style>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-materialDetail-edit" th:object="${MaterialDetail}">
        <input hidden="hidden" th:field="*{id}">
        <div class="form-group">
            <label class="col-sm-3 control-label">编号：</label>
            <div class="col-sm-8">
                <input id="materialId" name="materialId" th:field="*{materialId}" class="form-control" type="text" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">物料编码：</label>
            <div class="col-sm-8">
                <input id="materialProduct" name="materialProduct" th:field="*{materialProduct}" class="form-control" type="text" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">质检属性：</label>
            <div class="col-sm-8">
                <select id="result" name="result" class="form-control" v-model="checkResult">
                    <option value="0">OK</option>
                    <option value="1">NG</option>
                    <option value="3">灰度异常</option>
                    <option value="4">长度异常</option>
                    <option value="5">宽度异常</option>
                    <option value="6">位置异常</option>
                </select>
            </div>
        </div>
    </form>
    <form th:object="${MaterialDetail}">
        <input id="checkResult" th:field="*{result}" type="hidden">
    </form>
</div>
<div th:include="include::footer"></div>
<script type="text/javascript">
    var prefix = ctx + "in/MaterialDetail";

    function submitHandler(){
        if($.validate.form()){
            $.operate.save(prefix + "/editsave", $('#form-materialDetail-edit').serialize());
        }
    };

    var app = new Vue({
        el: '.wrapper',
        data: {
            checkResult: ''
        },
        created(){
            this.checkResult = document.getElementById('checkResult').value;
        }
    })
</script>
</body>
</html>
